package 设计模式.策略模式;

import 设计模式.策略模式.逻辑分支.ICouponDiscount;

import java.math.BigDecimal;

/**
 * @description:
 * @author: 小白白
 * @create: 2021-10-10
 **/

public class Context<T> {

    private ICouponDiscount<T> couponDiscount;

    public Context(ICouponDiscount<T> couponDiscount) {
        this.couponDiscount = couponDiscount;
    }

    public BigDecimal discount(T t, BigDecimal price) {
        return couponDiscount.couponValid(t, price);
    }

}
